package com.demo.crm.service.impl;

import com.demo.crm.dao.TAuthorMapper;
import com.demo.crm.entity.TAuthor;
import com.demo.crm.service.TestService;
import com.github.pagehelper.PageHelper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 测试实现类
 *
 * @author zhangmz
 * @create 17/4/23
 */
@Service
public class TestServiceImpl implements TestService {

    @Autowired
    private TAuthorMapper tAuthorMapper;

    @Override
    public String hello() {
        return "hello,TestServiceImpl.class";
    }

    @Override
    public TAuthor getAuthor(Long id) {
        return this.tAuthorMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<TAuthor> findList(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize,true);
        return this.tAuthorMapper.selectAll();
    }
}
